<template>
  <div class="goodsItem">
    <div class="item" v-for="obj in arr" :key="obj.id" @click.stop="Fn(obj.id , obj)">
      <img :src="obj.list_pic_url" alt="" />
      <p>{{ obj.name }}</p>
      <span>${{ obj.retail_price }}</span>
    </div>

  </div>
</template>
<script>
import EventBus from "@/EventBus"
// console.log();
export default {
  name: "goodsItem",
  data() {
    return {
     
    };
  },
  props: {
    arr: {
      type: Array,
      required: true,
    },
    isShowPage:{
      type:Boolean,
    }
  },
  methods: {
    Fn(id,obj) {
      this.$emit("changePage",true)
      this.$emit("sendId",id)
      console.log(obj);
      EventBus.$emit("send",obj);
    },
  },
  components: {

  },
};
</script>

<style scoped lang="scss">
.goodsItem {
  display: flex;
  flex-wrap: wrap;
  //   justify-content: space-evenly;
  .item {
    width: 50vw;
    text-align: center;
    font-size: 30px;
    color: #666;
    span {
      color: #c00000;
    }
  }

  img {
    width: 100%;
  }
}


</style>
